﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using bugTrackingApp.Models;

namespace bugTrackingApp.Controllers
{
    public class HomeController : Controller
    {
        private List<WorkItem> _buglist;
        public HomeController()
        {
            _buglist = GetBugList();
        }
        public ActionResult Index()
        {
            IndexViewModel model = new IndexViewModel();
            model.BugList = _buglist;

            return View(model);
        }

        private static List<WorkItem> GetBugList()
        {

            List<WorkItem> model1 = new List<WorkItem>();
            Bug bug1 = new Bug();
            bug1.StepsToReproduce = "Mate";
            bug1.Title = "Bug 1";
            bug1.DateCreated = new DateTime();


            model1.Add(bug1);
            return model1;

            //phone1.NumberofTiles = 4;
            //phone1.MakeCall = true;
            //phone1.HasGPS = true;

            //SmartPhone phone2 = new iPhone();
            //phone2.HasGPS = false;
            //phone2.MakeCall = true;

            //smartphones.Add(phone1);
            //smartphones.Add(phone2);
            //return smartphones;
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}